// default value

let [name = 'Guest', surname = 'Anonymous'] = ['Julius'];

alert(name);
alert(surname);


let [name2 = prompt('name?'), surname2 = prompt('surname?')] = ['Julius'];

alert(name2);
alert(surname2);


// destructing of Object
let options = {
    title: "Menu",
    width: 100,
    height: 200
};

let {title , width, height} = options;

alert(title);
alert(width);
alert(height);


// more complex left variable
// use colon  A:B, A means what the value is , B means who the value assign to 
let {width: w, height: h, title: title2} = options;

alert(title2);
alert(w);
alert(h);